<% layout('/layouts/default.html', {title: '联系老师管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(tcontactTeacher.isNewRecord ? '新增联系老师' : '编辑联系老师')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${tcontactTeacher}" action="${ctx}/zx/contact/teacher/tcontactTeacher/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('二维码')}：</label>
							<div class="col-sm-10">
								<#form:fileupload path="qrCode" 
								id="qrCode" 
								returnPath="true"
								filePathInputId="qrCode"
								maxUploadNum="1"
                                imageMaxWidth='-1'
								imageMaxHeight='-1'
								uploadType="image" class="" readonly="false"/>
								<#form:input path="qrCode" name="qrCode" class="form-control hide"/>

							</div>
						</div>
					</div>
				</div>
				<div class="row">
					
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('教师主键')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
							<#form:select path="teacherId" items="${teacherList}"
									itemLabel="userName" itemValue="userCode" blankOption="true" class="form-control required"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('考试类别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
							    <#form:select path="teacherType" dictType="t_teacher_type" blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				
				
				
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('zx:contact:teacher:tcontactTeacher:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>